class Solution {
public:
    int is_val(int n) {
        if (n <= 10) return 0;
        string s = to_string(n);
        if (s.size() & 1) return 0; 
        int i = 0, j = s.size() - 1, a = 0, b = 0;
        while (i < j) {
            a += s[i] - '0';
            b += s[j] - '0';
            i++, j--;
        }
        return a == b;
    }
    int countSymmetricIntegers(int low, int high) {
        int cnt = 0;
        for (int i = low; i <= high; i++) {
            if (!is_val(i)) continue;
            cnt += 1;
        }
        return cnt;
    }
};
